package xml;

import java.awt.*;

import javax.xml.bind.annotation.adapters.XmlAdapter;

public class ColorAdapter extends XmlAdapter<Integer, Color> {
	
	public Integer marshal(Color color) throws Exception {
		int intColor = color.getRGB();

		return intColor;
	}

	// reverse operation: map XML type to Java
	public Color unmarshal(Integer intColor) throws Exception { 
		Color color = new Color(intColor);
        
        return color;
	}
}
